package com.demo.rabbitmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@ConditionalOnProperty(name = "spring.rabbitmq.extra.cluster.consumer.enable", havingValue = "true")
public class ClusterDirectConsumer {

    @RabbitListener(id = "cluster_direct_queue", queues = "cluster_direct_queue")
    public void clusterDirectExchange(String content) {
        log.info("消费者，消费消息内容：" + content);
    }

    @RabbitListener(id = "mirror_direct_queue", queues = "mirror_direct_queue")
    public void mirrorDirectExchange(String content) {
        log.info("消费者，消费消息内容：" + content);
    }
}
